class mssqlcluster::admember (
  $newdnsserver='10.0.0.71',
  $interface='Ethernet 3',
){

# netsh interface ipv4 add dnsserver "Ethernet" address=192.168.x.x index=1
# netsh interface ipv4 show dnsserver

  exec { 'setdns':
    command => "netsh.exe interface ipv4 add dnsserver \"${interface}\" address=${newdnsserver} index=1",
    unless  => "cmd.exe /c \"netsh.exe interface ipv4 show dnsserver \"${interface}\" | findstr.exe /C:\"${newdnsserver}\"\"",
    path => $::path,
  }

  class { 'domain_membership':
    domain       => 'ec2.internal',
    username     => 'Administrator',
    password     => '@kDnq*kC=*?',
    join_options => '3',
    require      => Exec['setdns'],
  }

}
